﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using MySql.Data.MySqlClient;
namespace MaterialezMuñoz
{
    public partial class ConsultasAdministrador : System.Web.UI.Page
    {
        
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void btnConsultaPedidoClientes_Click(object sender, EventArgs e)
        {
            llenarGV();
        }
        private void llenarGV()
        {
            string conn = "Server=localhost;UId=root;Password=123;database=sistemamat";
            string query = "select nombre, apellido from clientes inner join pedidos on(pedidos.id_cli = clientes.id_cli) and (clientes.id_cli = pedidos.id_cli)";
            MySqlConnection con = new MySqlConnection(conn);
            MySqlDataAdapter da = new MySqlDataAdapter(query, con);
            System.Data.DataSet ds = new System.Data.DataSet();
            da.Fill(ds, "sample_data");
            gvConsultas.DataSource = ds;
            gvConsultas.DataBind();
        }
    }
}